package com.isoft.c2team3service2.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft.c2team3service2.dto.ArtistDTO;
import com.isoft.c2team3service2.entity.Artist;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArtistMapper extends BaseMapper<Artist> {
    // 根据姓名模糊查询艺人（例如：搜索“周”返回“周杰伦”“周润发”等）
    @Select("SELECT * FROM artist WHERE name LIKE CONCAT('%', #{name}, '%')")
    List<Artist> selectByNameLike(String name);
    @Select("select id ,name from artist")
    List<Artist> selectIdName();
    @Select("select name from artist where user_id = #{id}")
    String  selectIs(@Param("id")Integer artistId);
    @Select("SELECT * from artist where id =#{artistId}")
    ArtistDTO selectArtistDTOById(Integer artistId);

    @Select("select * from artist")
    List<ArtistDTO> selectAll();
}